package com.manager.core.module.manager.controller;

import com.manager.commons.annotation.Module;
import com.manager.commons.base.DataGrid;
import com.manager.core.module.manager.entity.PlatformUserLog;
import com.manager.core.module.manager.service.PlatformUserLogService;
import com.manager.gen.web.controller.AdminController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * 控制器
 * @author H
 * @version 1.0
 */
@Controller
@Module(parent = "operation-log", title = "用户操作日志",show = false,code = "/platform/userOperateLog")
public class PlatformUserLogController extends AdminController<PlatformUserLog> {
	private final String baseUrl = "/platform/userOperateLog";
	@Autowired
	private PlatformUserLogService _service;

	/**
	 * 列表
	 * @return
	 */
	@RequestMapping(baseUrl+"/index")
	public ModelAndView index() {
		return getModelAndView(baseUrl+"/user-log-index");
	}

	/**
	 * 分页
	 * @return
	 */
	@RequestMapping(value = baseUrl+"/list", method = RequestMethod.POST)
	public @ResponseBody DataGrid list() {
		return _service.queryPage(getParams());
	}

	@Override
	public PlatformUserLog getModel() {
		return new PlatformUserLog();
	}
}